import type { RouteRecordRaw } from 'vue-router';

const bomRoute: RouteRecordRaw = {
  path: '/bom',
  name: 'BOM',
  redirect: '/bom/list',
  meta: {
    title: 'BOM管理',
    icon: 'mdi:file-tree',
    sort: 3,
  },
  children: [
    {
      path: 'list',
      name: 'BOMList',
      component: () => import('#/views/bom/list.vue'),
      meta: {
        title: 'BOM列表',
        icon: 'mdi:format-list-bulleted',
        sort: 1,
        keepAlive: true,
        permission: ['product:bom:list'],
      },
    },
    {
      path: 'detail/:id',
      name: 'BOMDetail',
      component: () => import('#/views/bom/modules/detail.vue'),
      meta: {
        title: 'BOM详情',
        icon: 'mdi:file-document',
        hideMenu: true,
        permission: ['product:bom:detail'],
      },
    },
  ],
};

export default [bomRoute];
